﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace JumbotPay.API.Alipay.Mobile
{
    /// <summary>
    /// config 的摘要说明
    /// </summary>
    public class Config
    {
        public Config(string account_alipay)
        {
            string strXmlFile = HttpContext.Current.Server.MapPath("~/_data/config/payment_alipay_" + account_alipay + ".config");
            JumbotPay.DBUtility.XmlControl XmlTool = new JumbotPay.DBUtility.XmlControl(strXmlFile);
            app_id = XmlTool.GetText("Root/app_id");
            private_key = XmlTool.GetText("Root/private_key",true).Trim();
            alipay_public_key = XmlTool.GetText("Root/alipay_public_key", true).Trim();
            XmlTool.Dispose();

            return_url = JumbotPay.Utils.App.Url + JumbotPay.Utils.App.Path + "alipay_mobile/return_url_" + account_alipay + ".aspx";
            notify_url = JumbotPay.Utils.App.Url + JumbotPay.Utils.App.Path + "alipay_mobile/notify_url_" + account_alipay + ".aspx";
        }

        // 支付宝网关
        public string gatewayUrl = "https://openapi.alipay.com/gateway.do";


        // 应用ID,您的APPID
        public string app_id = "";

        // 商户私钥，您的原始格式RSA私钥
        public string private_key = "";

        // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
        public string alipay_public_key = "";

        // 签名方式
        public string sign_type = "RSA2";

        // 编码格式
        public string charset = "UTF-8";

        /// <summary>
        /// 支付完成异步通知接收地址
        /// </summary>
        public string notify_url = "http://unipay.jumbot.net/wxpay/notify_url.aspx";
        /// <summary>
        /// 支付完成同步回调地址
        /// </summary>
        public string return_url = "http://unipay.jumbot.net/wxpay/return_url.aspx";
    }
}